package com.example.work9.Utils;

import com.google.gson.Gson;

public class GsonUtil {
    private static final Gson gson = new Gson();

    public static <T> String ObjectToJson(T obj, Class<T> tClass) {
        return gson.toJson(obj, tClass);
    }

    public static <T> T JsonToObject(String json, Class<T> tClass) {
        return gson.fromJson(json, tClass);
    }
}
